import request from '@/utils/request'

// 查询服务设施列表
export function listFacility(query) {
  return request({
    url: '/camp/facility/list',
    method: 'get',
    params: query
  })
}

// 查询所有启动状态的服务设备类型列表
export function listTypeByStateOpen() {
  return request({
    url: '/camp/type/listByStateOpen',
    method: 'get'
  })
}

// 查询服务设施详细
export function getFacility(facilityId) {
  return request({
    url: '/camp/facility/' + facilityId,
    method: 'get'
  })
}

// 新增服务设施
export function addFacility(data) {
  return request({
    url: '/camp/facility',
    method: 'post',
    data: data
  })
}

// 修改服务设施
export function updateFacility(data) {
  return request({
    url: '/camp/facility',
    method: 'put',
    data: data
  })
}

// 删除服务设施
export function delFacility(facilityId) {
  return request({
    url: '/camp/facility/' + facilityId,
    method: 'delete'
  })
}
